package com.example.ass7.collision;

import com.example.ass7.geometryprimitives.Counter;
import com.example.ass7.sprite.Ball;
import com.example.ass7.sprite.Block;
import com.example.ass7.sprite.Paddle;

/**
 * @author Meirav Ben Izhak
 */
public class ScoreTrackingListener implements HitListener {
    private final Counter currentScore;

    /**
     * @param scoreCounter
     *            scoreCounter
     */
    public ScoreTrackingListener(Counter scoreCounter) {
        this.currentScore = scoreCounter;
    }

    @Override
    public void hitEvent(Block beingHit, Paddle beingHit2, Ball hitter) {
        if (beingHit.getHitPoints() == 0) {
            this.currentScore.increase(100);
        }
    }
}